# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-mccabe
_pkgname=mccabe
pkgver=0.7.0
pkgrel=2
pkgdesc="A McCabe complexity checker plugin for Flake8"
url="https://github.com/PyCQA/mccabe"
arch="noarch"
license="MIT"
makedepends="py3-setuptools"
checkdepends="py3-hypothesis py3-pytest py3-pytest-runner"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

# temp fix while !check on riscv64
[ "$CARCH" = "riscv64" ] && makedepends="$makedepends $checkdepends"

options="!check" # hypothesmith needed
replaces="py-mccabe" # Backwards compatibility
provides="py-mccabe=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
3e4141033c63434fad183f62dece872554302aeee8cb789586ac7d6d748d198799e2797df1d58458f4d431734f8899f11022d76666c848d43e6271304776346d  mccabe-0.7.0.tar.gz
"
